import 'dart:convert';

class Configuration {
  Configuration({
    this.playDefaultAudioTrack,
    this.displayMissingEpisodes,
    this.groupedFolders,
    this.subtitleMode,
    this.displayCollectionsView,
    this.enableLocalPassword,
    this.orderedViews,
    this.latestItemsExcludes,
    this.myMediaExcludes,
    this.hidePlayedInLatest,
    this.rememberAudioSelections,
    this.rememberSubtitleSelections,
    this.enableNextEpisodeAutoPlay,
  });

  bool playDefaultAudioTrack;
  bool displayMissingEpisodes;
  List<dynamic> groupedFolders;
  String subtitleMode;
  bool displayCollectionsView;
  bool enableLocalPassword;
  List<dynamic> orderedViews;
  List<dynamic> latestItemsExcludes;
  List<dynamic> myMediaExcludes;
  bool hidePlayedInLatest;
  bool rememberAudioSelections;
  bool rememberSubtitleSelections;
  bool enableNextEpisodeAutoPlay;

  factory Configuration.fromRawJson(String str) => Configuration.fromJson(json.decode(str));

  String toRawJson() => json.encode(toJson());

  factory Configuration.fromJson(Map<String, dynamic> json) => Configuration(
        playDefaultAudioTrack: json["PlayDefaultAudioTrack"],
        displayMissingEpisodes: json["DisplayMissingEpisodes"],
        groupedFolders: List<dynamic>.from(json["GroupedFolders"].map((x) => x)),
        subtitleMode: json["SubtitleMode"],
        displayCollectionsView: json["DisplayCollectionsView"],
        enableLocalPassword: json["EnableLocalPassword"],
        orderedViews: List<dynamic>.from(json["OrderedViews"].map((x) => x)),
        latestItemsExcludes: List<dynamic>.from(json["LatestItemsExcludes"].map((x) => x)),
        myMediaExcludes: List<dynamic>.from(json["MyMediaExcludes"].map((x) => x)),
        hidePlayedInLatest: json["HidePlayedInLatest"],
        rememberAudioSelections: json["RememberAudioSelections"],
        rememberSubtitleSelections: json["RememberSubtitleSelections"],
        enableNextEpisodeAutoPlay: json["EnableNextEpisodeAutoPlay"],
      );

  Map<String, dynamic> toJson() => {
        "PlayDefaultAudioTrack": playDefaultAudioTrack,
        "DisplayMissingEpisodes": displayMissingEpisodes,
        "GroupedFolders": List<dynamic>.from(groupedFolders.map((x) => x)),
        "SubtitleMode": subtitleMode,
        "DisplayCollectionsView": displayCollectionsView,
        "EnableLocalPassword": enableLocalPassword,
        "OrderedViews": List<dynamic>.from(orderedViews.map((x) => x)),
        "LatestItemsExcludes": List<dynamic>.from(latestItemsExcludes.map((x) => x)),
        "MyMediaExcludes": List<dynamic>.from(myMediaExcludes.map((x) => x)),
        "HidePlayedInLatest": hidePlayedInLatest,
        "RememberAudioSelections": rememberAudioSelections,
        "RememberSubtitleSelections": rememberSubtitleSelections,
        "EnableNextEpisodeAutoPlay": enableNextEpisodeAutoPlay,
      };

  @override
  String toString() {
    return 'Configuration{playDefaultAudioTrack: $playDefaultAudioTrack, displayMissingEpisodes: $displayMissingEpisodes, groupedFolders: $groupedFolders, subtitleMode: $subtitleMode, displayCollectionsView: $displayCollectionsView, enableLocalPassword: $enableLocalPassword, orderedViews: $orderedViews, latestItemsExcludes: $latestItemsExcludes, myMediaExcludes: $myMediaExcludes, hidePlayedInLatest: $hidePlayedInLatest, rememberAudioSelections: $rememberAudioSelections, rememberSubtitleSelections: $rememberSubtitleSelections, enableNextEpisodeAutoPlay: $enableNextEpisodeAutoPlay}';
  }
}
